<template>
<div>

  <p>欢迎你：{{names}}小朋友</p>
  你当前所在的班级是:{{cla.cla.name}}
  <ul>
    <li v-for="i in cla.cla.course.name">{{i.name}}</li>
  </ul>

</div>
</template>

<script>
export default {
  name: "stu",
  data(){
    return{
      id:localStorage.getItem('id'),
      names:localStorage.getItem('name'),
      cla:{},

    }
  },
  methods:{
      get_class(){
        this.$axios.get('users/reg/?id='+this.id)
        .then(res=>{
          if (res.data.code==200){
            this.cla=res.data.list
          }
        })
      }
  },
  mounted() {
    this.get_class()
  }
}
</script>

<style scoped>

</style>
